package com.basic;

import java.util.Date;


public class ChildQ extends ParentQ {
	
	public void test2() {
		System.out.println("ChildQ");
	}
	
	
	public void test() {
		System.out.println(new Date().toString());
	}
	
	public static void main(String[] args) {
		//父类引用指向子类对象，多态
		InterfaceQ interfaceQ = new ChildQ();
		interfaceQ.test();
		//强制类型转换
		((ChildQ)interfaceQ).test2();
		
		//父类引用指向子类对象，多态
		ParentQ parentQ = new ChildQ();
		parentQ.test();
	}
}
